service.playSoundTick(3)
require "import"
import "android.widget.*"
import "android.content.Intent"
import "com.androlua.*"
import "java.io.*"

layout={
    GridView,
    id="grid",
    numColumns=2,
    layout_width="fill",
    layout_height="fill"
}

items={"Buka WhatsApp Messenger Beta","Buka WhatsApp Bisnis","Buka Facebook","Buka Instagram","Buka Messenger Lite","Buka Telegram","join group technology"}
dlg=LuaDialog(this)
dlg.View=loadlayout(layout)
grid.adapter=SingleLineAdapter(service, String(items))
dlg.setTitle ("menu sosmed  Satu Klik untuk Semua Aplikasi Sosial Media")
.setButton3("Batal",{onClick=function count=(nil) end})
dlg.show()
grid.onItemClick=function(l,v)
    dlg.dismiss()
    if v.text == "Buka WhatsApp Messenger Beta" then
if service.startApp("WhatsApp")
return true
end
        Toast.makeText(this, "Akan membuka WhatsApp Messenger Beta", Toast.LENGTH_SHORT).show()
        this.asyncSpeak( "Akan membuka WhatsApp Messenger Beta. Script by Nazar Muhammad")

    elseif v.text == "Buka WhatsApp Bisnis" then
if service.click({
{">WA Business",
}
})
return true
end
     Toast.makeText(this, "Akan membuka WhatsApp Bisnis", Toast.LENGTH_SHORT).show()
        this.asyncSpeak( "Akan membuka WhatsApp Bisnis. Script by Nazar Muhammad")

    elseif v.text == "Buka Facebook" then
        if service.startApp("Facebook") then
            Toast.makeText(this, "Akan membuka Facebook", Toast.LENGTH_SHORT).show()
            this.asyncSpeak( "Akan membuka Facebook")
        end

    elseif v.text == "Buka Instagram" then
        if service.startApp("Instagram") then
            Toast.makeText(this, "Akan membuka Instagram", Toast.LENGTH_SHORT).show()
            this.asyncSpeak( "Akan membuka Instagram")
        end
    
    elseif v.text == "Buka Messenger Lite" then
        if service.startApp("Lite") then
            Toast.makeText(this, "Akan membuka Messenger Lite", Toast.LENGTH_SHORT).show()
            this.asyncSpeak( "Akan membuka Messenger Lite")
        end
    
    elseif v.text == "Buka Telegram" then
        if service.startApp("Telegram") then
            Toast.makeText(this, "Akan membuka Telegram", Toast.LENGTH_SHORT).show()
            this.asyncSpeak( "Akan membuka Telegram")
        end
    
    elseif v.text == "join group technology" then
        service.openUrl("https://chat.whatsapp.com/LRpgEiUp75b8MQzuhrcFpU")
        Toast.makeText(this, "Akan membuka chat WhatsApp", Toast.LENGTH_SHORT).show()
        this.asyncSpeak( "Akan membuka grup  WhatsApp")
    end
end